Level Of Detail (LOD) Expressions
1. What Is LOD?
When you build a chart, the numbers are computed at the level your chart is grouped by. If your X-axis is Category, you see one sales total per category.
LOD (Level of Detail) lets you compute a number at a different grouping level and bring it into your chart — without changing the chart's grouping.
🎯 Example: "I want total sales by category — but also each category's share of the grand total, a single number computed across ALL data." That grand total is a different "level of detail." LOD makes it possible.
1.1 How to Create LOD (Level of Detail) Formulas
Steps to Create:
- Open Visualizer and navigate to the column bar at the top of the visualizer.
- Click "Create Formula" to open the formula editor.
- Give your new column a name.
- Enter your LOD formula in the editor. For example:
LOD_FIXED(SUM("Revenue"), "Region")
- Click Save to create the calculated column.
- The new column will appear alongside your other columns and can be dragged into any widget configuration.
Once created, the LOD column will behave like any other column in your dataset. You can use it along with any dimension in charts, the computed value stays fixed at the level you defined, regardless of how the visualization is grouped.
2. The Three LOD Types
| LOD Type | What It Does | When to Use |
|---|---|---|
| LOD_FIXED | Compute at exactly these dimensions — ignores chart grouping | Grand totals, per-customer totals, fixed benchmarks |
| LOD_INCLUDE | Add extra dimensions to the chart grouping (finer detail) | Per-customer averages shown at category level |
| LOD_EXCLUDE | Remove a dimension from the chart grouping (coarser detail) | Yearly averages alongside monthly data |
💡 Tip: LOD_FIXED is the most commonly used type. Master it first before moving to INCLUDE or EXCLUDE.
3. Syntax
Every LOD formula follows this pattern:
LOD_FIXED( AGGREGATION(measure), dim1, dim2, ... )
LOD_INCLUDE( AGGREGATION(measure), dim1, dim2, ... )
LOD_EXCLUDE( AGGREGATION(measure), dim1, dim2, ... )
Golden rule: Aggregation always comes FIRST. Dimensions come AFTER.
| Part | Example | Meaning |
|---|---|---|
| Aggregation | SUM(sales) | What to compute |
| Dimensions | category, region | What to group by |
Examples:
LOD_FIXED(SUM(sales)) → Grand total
LOD_FIXED(SUM(sales), category) → Total per category
LOD_FIXED(SUM(sales), category, region) → Total per category+region
LOD_INCLUDE(SUM(sales), customer_id) → Add customer detail
LOD_EXCLUDE(SUM(sales), month) → Remove month from view
💡 Tip: LOD formulas are case-insensitive and whitespace-tolerant.
lod_fixed(sum(sales))works fine.
4. Supported Aggregations
| Function | What It Does | Aliases |
|---|---|---|
| SUM(column) | Total | — |
| AVG(column) | Average | AVERAGE |
| COUNT(column) | Row count |